home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 June
/
ccd0605.iso
/
Software
/
Freeware
/
Programare
/
highlight
/
highlight-W32GUI-2.2-10b-Setup.exe
/
{app}
/
src
/
elementstyle.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2004-10-21
|
2KB
|
84 lines
/***************************************************************************
elementstyle.cpp - description
-------------------
begin : Son Nov 10 2002
copyright : (C) 2002 by AndrΘ Simon
email : andre.simon1@gmx.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "elementstyle.h"
namespace highlight {
ElementStyle::ElementStyle(StyleColour col, bool b, bool i, bool u)
: colour(col) , bold(b), italic(i), underline(u)
{}
ElementStyle:: ElementStyle(const string & elementStyleString)
: bold(false), italic(false), underline(false)
{
set(elementStyleString);
}
ElementStyle::ElementStyle()
: bold(false), italic(false), underline(false)
{}
void ElementStyle::set(const string & elementStyleString){
istringstream valueStream(elementStyleString.c_str());
string r, g, b, attr;
valueStream >> r;
valueStream >> g;
valueStream >> b;
colour.setRedValue(r);
colour.setGreenValue(g);
colour.setBlueValue(b);
while ( valueStream >> attr)
{
if (attr=="italic")
{
italic = true;
}
else if (attr=="bold")
{
bold = true;
}
else if (attr=="underline")
{
underline = true;
}
}
}
ElementStyle::~ElementStyle()
{}
bool ElementStyle::isItalic() const
{
return italic;
}
bool ElementStyle::isBold() const
{
return bold;
}
bool ElementStyle::isUnderline() const
{
return underline;
}
StyleColour ElementStyle::getColour() const
{
return colour;
}
}